package com.steak.concurrent.CompletableFuture.api.completefuture;

import com.steak.concurrent.common.R;
import com.steak.concurrent.common.User;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

/**
 * @author 刘牌
 * @date 2022/3/2716:47
 */
public class CompleteFutureTest {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        CompletableFuture<R> future = CompletableFuture.completedFuture(getUserInfo());
        System.out.println(future.get());
    }
    public static R getUserInfo(){
        return new R(200,"获取用户信息成功",new User("小四哥","123456","13657746155"));
    }
}
